package window;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import panels.CopyPanel;

public class PlayerWindow {

	private JFrame frame;
	
	private MainWindow	DM = null;				// The main window that represents the dungeon master
	private CopyPanel	copyPanel = null;
	/**
	 * Create the application.
	 */
	public PlayerWindow() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		copyPanel = new CopyPanel();
		frame.getContentPane().add(copyPanel, BorderLayout.CENTER);
	}

	public MainWindow getDM() {
		return DM;
	}

	public void setDM(MainWindow dM) {
		DM = dM;
		if (DM!=null) {
			copyPanel.setRenderer(DM.getPaintPanel());
		} else {
			copyPanel.setRenderer(null);
		}
	}

	public JFrame getFrame() {
		return frame;
	}
}
